﻿#region File Info Header
/*________________________________________________________________________________________

  Copyright (C) 2011 Jason Zhang, eagleboost@msn.com

  * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 
  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 
  * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

________________________________________________________________________________________*/
#endregion File Info Header

namespace EagleBoost.Wpf.Presentation.Extensions
{
  using System;
  using System.Windows.Threading;

  /// <summary>
  /// Extension methods for DispatcherObject
  /// </summary>
  public static class DispatcherObjectExtension
  {
    /// <summary>
    /// Invoke the action on DispatcherPriority.Loaded
    /// </summary>
    /// <param name="obj"></param>
    /// <param name="action"></param>
    public static void InvokeOnLoaded(this DispatcherObject obj, Action action)
    {
      obj.Dispatcher.BeginInvoke(action, DispatcherPriority.Loaded);
    }
  }
}
